home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / NET / IF_INET6.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  3KB  |  135 lines

  1. /*
  2.  *    inet6 interface/address list definitions
  3.  *    Linux INET6 implementation 
  4.  *
  5.  *    Authors:
  6.  *    Pedro Roque        <roque@di.fc.ul.pt>    
  7.  *
  8.  *
  9.  *    This program is free software; you can redistribute it and/or
  10.  *      modify it under the terms of the GNU General Public License
  11.  *      as published by the Free Software Foundation; either version
  12.  *      2 of the License, or (at your option) any later version.
  13.  */
  14.  
  15. #ifndef _NET_IF_INET6_H
  16. #define _NET_IF_INET6_H
  17.  
  18. /* These flags match corresponding IFA_F_* flags but ADDR_INVALID,
  19.    which is invisible externally.
  20.  */
  21.  
  22. #define ADDR_PERMANENT    0x80
  23.  
  24. #define DAD_COMPLETE    0x00
  25. #define DAD_INCOMPLETE    0x40
  26. #define DAD_STATUS    0x40
  27.  
  28. #define ADDR_STATUS    0x21
  29. #define ADDR_DEPRECATED 0x20
  30. #define ADDR_INVALID    0x01
  31.  
  32.  
  33.  
  34. #define IF_RA_RCVD    0x20
  35. #define IF_RS_SENT    0x10
  36.  
  37. #ifdef __KERNEL__
  38.  
  39. struct inet6_ifaddr 
  40. {
  41.     struct in6_addr        addr;
  42.     __u32            prefix_len;
  43.     
  44.     __u32            valid_lft;
  45.     __u32            prefered_lft;
  46.     unsigned long        tstamp;
  47.  
  48.     __u8            probes;
  49.     __u8            flags;
  50.  
  51.     __u16            scope;
  52.  
  53.     struct timer_list    timer;
  54.  
  55.     struct inet6_dev    *idev;
  56.  
  57.     struct inet6_ifaddr    *lst_next;      /* next addr in addr_lst */
  58.     struct inet6_ifaddr    *if_next;       /* next addr in inet6_dev */
  59. };
  60.  
  61.  
  62. struct ipv6_mc_socklist
  63. {
  64.     struct in6_addr        addr;
  65.     int            ifindex;
  66.     struct ipv6_mc_socklist *next;
  67. };
  68.  
  69. #define MAF_TIMER_RUNNING    0x01
  70. #define MAF_LAST_REPORTER    0x02
  71. #define MAF_LOADED        0x04
  72.  
  73. struct ifmcaddr6
  74. {
  75.     struct in6_addr        mca_addr;
  76.     struct device        *dev;
  77.     struct ifmcaddr6    *next;
  78.     struct ifmcaddr6    *if_next;
  79.     struct timer_list    mca_timer;
  80.     unsigned        mca_flags;
  81.     atomic_t        mca_users;    
  82. };
  83.  
  84. #define    IFA_HOST    IPV6_ADDR_LOOPBACK
  85. #define    IFA_LINK    IPV6_ADDR_LINKLOCAL
  86. #define    IFA_SITE    IPV6_ADDR_SITELOCAL
  87. #define    IFA_GLOBAL    0x0000U
  88.  
  89. struct ipv6_devconf
  90. {
  91.     int        forwarding;
  92.     int        hop_limit;
  93.     int        mtu6;
  94.     int        accept_ra;
  95.     int        accept_redirects;
  96.     int        autoconf;
  97.     int        dad_transmits;
  98.     int        rtr_solicits;
  99.     int        rtr_solicit_interval;
  100.     int        rtr_solicit_delay;
  101.  
  102.     void        *sysctl;
  103. };
  104.  
  105. struct inet6_dev 
  106. {
  107.     struct device        *dev;
  108.  
  109.     struct inet6_ifaddr    *addr_list;
  110.     struct ifmcaddr6    *mc_list;
  111.     __u32            if_flags;
  112.  
  113.     struct neigh_parms    *nd_parms;
  114.     struct inet6_dev    *next;
  115.     struct ipv6_devconf    cnf;
  116. };
  117.  
  118. extern struct ipv6_devconf ipv6_devconf;
  119.  
  120. extern __inline__ void ipv6_eth_mc_map(struct in6_addr *addr, char *buf)
  121. {
  122.     /*
  123.      *    +-------+-------+-------+-------+-------+-------+
  124.      *      |   33  |   33  | DST13 | DST14 | DST15 | DST16 |
  125.      *      +-------+-------+-------+-------+-------+-------+
  126.      */
  127.  
  128.     buf[0]= 0x33;
  129.     buf[1]= 0x33;
  130.  
  131.     memcpy(buf + 2, &addr->s6_addr32[3], sizeof(__u32));
  132. }
  133. #endif
  134. #endif
  135.